package com.community.service.login;


import com.community.mapper.login.LoginMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginService {

    @Autowired
    private LoginMapper loginMapper;


    public boolean exist(String mobile) {


        return loginMapper.exist(mobile) != 0;
    }

    public String getId(String mobile) {

        return loginMapper.getId(mobile);
    }


    public void register(String mobile, String uuid, String token, String refreshToken) {

        loginMapper.register(mobile, uuid, token, refreshToken);
    }

    public void refreshToken(String uuid, String newAccessToken, String newRefreshToken) {

        loginMapper.refreshToken(uuid, newAccessToken, newRefreshToken);
    }
}
